package model

import (
	"gorm.io/gorm"
	"time"
)

type GoodImage struct {
	Id        uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	GoodId    int64          `gorm:"column:good_id;type:bigint;comment:商品id;default:NULL;" json:"good_id"`          // 商品id
	Url       string         `gorm:"column:url;type:varchar(255);comment:商品资源;default:NULL;" json:"url"`            // 商品资源
	Status    int8           `gorm:"column:status;type:tinyint;comment:资源类型 1:图片 2:视频;default:NULL;" json:"status"` // 资源类型 1:图片 2:视频
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (g *GoodImage) TableName() string {
	return "good_image"
}
